<template>
  <div>
    <el-form class="input-form"
      label-position="right"
      label-width="120px"
      ref="editForm"
      :rules="propRules"
      :disabled="propReadonly"
      :model="form"
    >
                    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="品名" prop="matrName">
          <el-input v-model="form.matrName" />
        </el-form-item>
      </el-col>
                      <el-col :span="12">
        <el-form-item label="品规" prop="matrSpec">
          <el-input v-model="form.matrSpec" />
        </el-form-item>
      </el-col>
          </el-row>
                    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="单位" prop="matrUnit">
          <el-input v-model="form.matrUnit" />
        </el-form-item>
      </el-col>
                      <el-col :span="12">
        <el-form-item label="包装单位" prop="packageUnit">
          <el-input v-model="form.packageUnit" />
        </el-form-item>
      </el-col>
          </el-row>
                    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="包装数量" prop="PackageQty">
          <el-input v-model="form.packageQty" />
        </el-form-item>
      </el-col>
                      <el-col :span="12">
        <el-form-item label="数量" prop="skuQty">
          <el-input v-model="form.skuQty" />
        </el-form-item>
      </el-col>
          </el-row>
                    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="单价" prop="skuPrice">
          <el-input v-model="form.skuPrice" />
        </el-form-item>
      </el-col>
                      <el-col :span="12">
        <el-form-item label="金额" prop="amount">
          <el-input v-model="form.amount" />
        </el-form-item>
      </el-col>
          </el-row>
                    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="批次" prop="lot">
          <el-input v-model="form.lot" />
        </el-form-item>
      </el-col>
                      <el-col :span="12">
        <el-form-item label="SN" prop="snNo">
          <el-input v-model="form.snNo" />
        </el-form-item>
      </el-col>
          </el-row>
                    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="RFID" prop="rfid">
          <el-input v-model="form.rfid" />
        </el-form-item>
      </el-col>
                      <el-col :span="12">
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" />
        </el-form-item>
      </el-col>
          </el-row>
    </el-form>
  </div>
</template>

<script>

export default {
  data() {
    return {
      form: {},
      viewData: {}
    }
  },
  methods: {  },
  created() {
    this.$emit('event-register', {
      validate: (callback) => {
        this.$refs.editForm.validate(callback)
      },
      beforeSave: () => {
        this.$emit('data-callback', this.form)
        return true
      },
      afterMove: (formData, initData) => {
        this.form = global.utils.jsonClone(formData)

        // 设置switch 元素默认值
      },
      afterSave: () => {  },
      beforeDelete: () => {
        return true
      },
      afterDelete: () => {
      },
      beforeFlow: (flowButtonKey) => {
        return true
      },
      afterFlow: (flowButtonKey) => {
      },
      beforeClose: () => {
        return true
      }
    })
  },
  props: {
    propParent: Object,
    propInitData: Object,
    propPrimaryKey: String,
    propDictionaries: Object,
    propCurrentRow: Object,
    propViewFormData: Object,
    propReadonly: Boolean,
    propStatus: String,
    propRules: Object
  },
  components: {
  },
  computed: {
  }
}
</script>

<style lang="scss" scoped>
  .container {
    width: 100%;
    height: 100%;
  }
</style>
